package br.com.fidalgotecnologia.layar.json;

import org.json.JSONException;
import org.json.JSONObject;

import br.com.fidalgotecnologia.layar.entity.Axis;

public class AxisJson {
	private Axis axis;
    private JSONObject json;
    
    public AxisJson(Axis axis){
    	this.axis = axis;
    	json = new JSONObject();
    	try {
			json.put( "x",this.axis.getX());
			json.put( "y",this.axis.getY());
			json.put( "z",this.axis.getZ());
			
			
			
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    
   public JSONObject getJson() {
	return json;
}
    
	@Override
	public String toString() {
		String retorno = null;
		
		try {
			
			retorno = json.toString();
		} catch (Exception  e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return retorno;
	}

}